package day14;
import java.io.*;

public class learn3 {
    public static void main(String[] args) throws IOException {
        //创建文件的对象
        FileReader th=null;
        //创建一个BufferReader对象
        BufferedReader ht=null;
        try{
      th=new FileReader("D:\\WUDownloadCache\\KH38.txt");
      ht=new BufferedReader(th);
        //定义一个字符串
        String str=null;
        //读取每一行
        while ((str=ht.readLine())!=null){
            //输出字符串
            System.out.println(str.toString());
        }
        }catch (Exception e){
            System.out.println("有异常");
        }finally {
            //关闭流
            th.close();
            ht.close();
        }
    }
}
